﻿using System.Collections.Generic;
using System.Linq;
using SinBiota.Model.Business.PersistenceServices.Interfaces;
using SinBiota.Model.Entities;
using SinBiota.Model.Persistence.Repositories.Interfaces;

namespace SinBiota.Model.Business.PersistenceServices.Implementation
{
    public class LogQueryingServices : ILogQueryingServices
    {
        private readonly ILogRepository _logRepository;

        public LogQueryingServices(ILogRepository logRepository)
        {
            _logRepository = logRepository;
        }

        public Log FindById(int id)
        {
            return _logRepository.FindById(id);
        }

        public IEnumerable<Log> FindAll()
        {
            return _logRepository.FindAll();
        }

        public IEnumerable<Log> FindByLevel(string level)
        {
            return _logRepository.FindByEqRestrictionListResult(x=>x.Level, level);
        }

        public IEnumerable<Log> FindByLogger(string logger)
        {
            return _logRepository.FindByEqRestrictionListResult(x=>x.Logger, logger);
        }
    }
}